import { http } from '@idmy/core'

export function createOrUpdateDict(model: any) {
  if (model.id) {
    return http.post('/api/sys/dict/update', model, { appKey: 'sys' })
  } else {
    return http.post('/api/sys/dict/create', model, { appKey: 'sys' })
  }
}

export function deleteDict(id: number) {
  return http.post('/api/sys/dict/delete/' + id, null, { appKey: 'sys' })
}

export function pageDict(pageIn: any) {
  return http.post('/api/sys/dict/page', pageIn, { appKey: 'sys' })
}

export function findChildrenDict(id: number) {
  return http.post('/api/sys/dict/findChildren/' + id, null, { appKey: 'sys' })
}
